﻿using System;
using System.Configuration;
using System.Diagnostics;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using Microsoft.Win32;
using WindowService;
using ConsoleProcessMonitor;

namespace CProcessMonitor
{
    public partial class CProcessMonitor : Service
    {
        public CProcessMonitor()
        {
            InitializeComponent();
            this.initLog();
            Log.WriteLog("CProcessMonitor init OK", LogType.Info);
        }

        protected override void OnStart(string[] args = null)
        {
            this.initService();
            this.StartTimer();
            Log.WriteLog("CProcessMonitor Start service OK", LogType.Info);
            Console.ReadLine();
        }

        protected override void OnPause()
        {
            StopTimer();
            Log.WriteLog("CProcessMonitor Pause service OK", LogType.Info);
        }

        protected override void OnContinue()
        {
            StartTimer();
            Log.WriteLog("CProcessMonitor Continue service OK", LogType.Info);
        }

        protected override void OnStop()
        {
            StopTimer();
            Log.WriteLog("CProcessMonitor Stopped service OK", LogType.Info);
        }

    }
}
